﻿
using System;
using System.Collections;
using System.Configuration;
using System.Data;

using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using HZ.DrugTrade.BLLFactory;
using HZ.DrugTrade.IBLL;
using HZ.DrugTrade.Model;
using System.Collections.Generic;
using HZ.DrugTrade.Model.Enum;

namespace HZ.DrugTrade.Web.Admin.BidProdManage
{
    public partial class CompanySelect : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                setBind();
            }
        }

        protected void AspNetPager1_OnPageChanged(object sender, EventArgs e)
        {
            setBind();
        }

        private void setBind()
        {
            IBLL_Company ic = Factory.BLL_Company();
            Model.Query.Company company = new HZ.DrugTrade.Model.Query.Company();
           // company.CompanyType
            company.CompanyName = txtCompanyName.Text.Trim();
            //company.CompanyType = HZ.DrugTrade.Model.Enum.EnumParse.GetCompanyType(ddlCompanyType.SelectedItem.Text);
            company.CompanyType = HZ.DrugTrade.Model.Enum.EnumCompanyType.配送企业;
            //AspNetPager1.PageSize = Constants.GRIDVIEW_PAGE_SIZE;
            int totalCount = 0;
            IList<Company> companyList = ic.GetCompanyByWhere(company, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, out totalCount);
            AspNetPager1.RecordCount = totalCount;
            gvwCompanyList.DataSource = companyList;
            gvwCompanyList.DataBind();
        }

        protected void btnQery_Click(object sender, EventArgs e)
        {
            AspNetPager1.CurrentPageIndex = 1;
            setBind();
        }

    }
}
